const http = require("http");
const url = require("url");
const fs = require("fs");
const querystring = require("querystring");

// 开启web服务器
http.createServer((req, res) => {

    if (req.url !== "/favicon.ico") {

        console.log(req.url)
        fs.readFile("./" + req.url, (err, data) => {
            console.log(req.url)
            if (!err) {
                res.write(data);
            } else {
                res.write("404");
            }
            res.end();
        })

    }
}).listen(3000);